extends Node2D
class_name AuthorityAura

var is_active: bool = false
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D

func _ready() -> void:
	# 确保节点存在
	if animated_sprite_2d:
		stop_aura()
	else:
		print("错误：找不到AnimatedSprite2D节点")
	
func start_aura():
	if not animated_sprite_2d:
		print("错误：AnimatedSprite2D节点不存在")
		return
		
	animated_sprite_2d.visible = true
	animated_sprite_2d.play()
	print("水之庇护光环启动")

func stop_aura():
	if not animated_sprite_2d:
		print("错误：AnimatedSprite2D节点不存在")
		return
		
	animated_sprite_2d.visible = false
	animated_sprite_2d.stop()
	print("水之庇护光环停止")

func set_aura_intensity(level: int):
	# 根据技能等级调整光环强度
	if not animated_sprite_2d:
		return
	var intensity = 0.5 + (level * 0.1)
	animated_sprite_2d.modulate.a = intensity

